/**
 * @author 陈泰来
 * @version V1.0
 * @Project echo-java-base
 * @Title 简单披萨工厂
 * @Description *
 * @Package designmodel.factorymodel2.ex1.factory
 * @date 2021/3/6 1:38 下午
 * @Copyright:学如逆水行舟，不进则退 .
 */
package designmodel.factorymodel2.ex1.factory;

import designmodel.factorymodel2.ex1.model.*;

public class SimplePizzaFactory {

    /**
     * @return designmodel.factorymodel2.ex1.model.Pizza
     * @author chentl
     * @description 根据类型获取披萨
     * @date 2021/3/6 1:46 下午
     * @params [type]
     */
    public static IPizza createPizza(String type) {
        switch (type) {
            case "cheese":
                return new CheesePizza();
            case "clamm":
                return new ClammPizza();
            case "pepporn":
                return new PeppornPizza();
            case "veggie":
                return new VeggiePizza();
            default:
                break;
        }
        System.out.println("未知pizza类型!");
        return null;
    }
}
